package org.luckyjourney.mapper.agent;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.luckyjourney.entity.agent.AgentTable;

/**
* @author 86155
* @description 针对表【agent_table(2智能体表)】的数据库操作Mapper
* @createDate 2024-03-21 15:10:29
* @Entity generator.entity.AgentTable
*/
@Mapper
public interface AgentTableMapper extends BaseMapper<AgentTable> {

    @Select("select * from agent_table where   instr(agent_name,#{agentName})")
    IPage<AgentTable> selectPageByName(Page<AgentTable> page,@Param("agentName") String agentName);

    //根据咨询师id查询到咨询师最近创建的一个智能体
    @Select("select * from agent_table where user_id=#{couselor_id} order by create_time desc limit 1")
    AgentTable selectOneAgent(Long couselor_id);
}




